/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controllers;

import entity.Payment;
import java.util.ArrayList;

public class PaymentController {

    public static boolean update(int id_customer,Payment payment){
        return new dao.Payment().updatePayment(id_customer, payment.getCost_room(),
                                               payment.getCost_service(),payment.getTotal(),
                                               payment.getPayment(),payment.getDate(),
                                               payment.getStatus());
    }
    
    public static ArrayList<Payment> getAll(){
        return new dao.Payment().getAllPayment();
    }
    public static int insert(Payment payment){
        return new dao.Payment().addPayment(payment.getId_customer(),payment.getCost_room(),
                                            payment.getCost_service(),payment.getTotal(),
                                            payment.getPayment(),payment.getDate(),payment.getStatus());
    }
    public static Payment getByIdCustomer(int id){    
        return new dao.Payment().getPaymentByIdCustomer(id);
    }
    public static boolean remove(int id){
        return new dao.Payment().deletePayment(id);
    }
}
